<?php
declare(strict_types=1);

namespace App\Http\Requests\Ai;

use App\Http\Requests\BaseValidate;

class FlagStudioImageValidate extends BaseValidate
{
    public function rules(): array
    {
        return [
            "prompt"           => "required",
            "guidance_scale"   => "sometimes|numeric",
            "height"           => "required|integer",
            "width"            => "required|integer",
            "negative_prompts" => "sometimes",
            "sampler"          => "sometimes:in:ddim,lmsd,pndm,euler_d,euler_a_d,dpm",
            "seed"             => "sometimes|min:1|max:100",
            "steps"            => "sometimes|min:1|max:100",
            "style"            => "sometimes",
            "upsample"         => "sometimes",
            "number"           => "integer|max:4"
        ];
    }

    public function messages(): array
    {
        return [
            "prompt.required"        => "提示词不能为空",
            "guidance_scale.numeric" => "知道比例不正确",
            "number.integer"         => "制作张数格式错误",
            "number.max"             => "制作张数最大为3",
            "height.integer"         => "高度必须是整数",
            "height.min"             => "高度最小3位数",
            "height.max"             => "高度最大4位数",
            "width.integer"          => "宽度必须是整数",
            "width.min"              => "宽度最小3位数",
            "width.max"              => "宽度最大4位数",
        ];
    }
}
